<template>
  <div>组件知识点</div>
  <hr />
  <MyComp @myevent="docomp">
    <div>你好</div>

    <template #totop>
      <div>世界</div>
    </template>
  </MyComp>
  <hr />
  <input type="text" v-model="subtitle" />
  <my-comp :mytitle="subtitle"></my-comp>
</template>
<script setup>
import { ref } from 'vue';
import MyComp from '../../components/MyComp.vue';

const subtitle = ref('传递给组件的属性值');
const docomp = (info) => {
  console.log('触发组件的事件：', info);
};
</script>
<style scoped></style>
